# @Time : 2020/7/18 14:17
# @Author : Fioman 
# @Phone : 13149920693
import cv2 as cv
import numpy as np

lena = cv.imread("lenaColor.png",cv.IMREAD_COLOR)
gray = cv.cvtColor(lena,cv.COLOR_BGR2GRAY)
bgr = cv.cvtColor(gray,cv.COLOR_GRAY2BGR)
"""
灰度图像转换为BGR图像的时候是均值化转换的,所以处理出来的图看起来依旧有点像是灰度图像.
因为三个通道的值是相等的.
"""

# 打印shape
print("lena.shape = {}".format(lena.shape))
print("gray.shape = {}".format(gray.shape))
print("bgr.shape = {}".format(bgr.shape))

# 显示效果
cv.imshow("lena",lena)
cv.imshow("gray",gray)
cv.imshow("bgr",bgr)
cv.waitKey(0)
cv.destroyAllWindows()